/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/** Clase entidad para el mapeo de tabla de base de datos Salida
* @author grupo de Tesis
*/
@Entity
@Table(name = "salida")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Salida.findAll", query = "SELECT s FROM Salida s"),
    @NamedQuery(name = "Salida.findByIdSalida", query = "SELECT s FROM Salida s WHERE s.idSalida = :idSalida"),
    @NamedQuery(name = "Salida.findByComAdicionales", query = "SELECT s FROM Salida s WHERE s.comAdicionales = :comAdicionales"),
    @NamedQuery(name = "Salida.findByFecSalida", query = "SELECT s FROM Salida s WHERE s.fecSalida = :fecSalida"),
    @NamedQuery(name = "Salida.findByAuAddUsr", query = "SELECT s FROM Salida s WHERE s.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Salida.findByAuAddDat", query = "SELECT s FROM Salida s WHERE s.auAddDat = :auAddDat"),
    @NamedQuery(name = "Salida.findByAuModUsr", query = "SELECT s FROM Salida s WHERE s.auModUsr = :auModUsr"),
    @NamedQuery(name = "Salida.findByAuModDat", query = "SELECT s FROM Salida s WHERE s.auModDat = :auModDat")})
public class Salida implements Serializable {
    @Column(name = "fecSalida")
    @Temporal(TemporalType.DATE)
    private Date fecSalida;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSalida")
    private Collection<Salidaxbeneficiario> salidaxbeneficiarioCollection;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idSalida")
    private Integer idSalida;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "comAdicionales")
    private String comAdicionales;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @JoinColumn(name = "idTipoSalida", referencedColumnName = "idTipoSalida")
    @ManyToOne(optional = false)
    private Tiposalida idTipoSalida;
    @JoinColumn(name = "idBeneficiario", referencedColumnName = "idBeneficiario")
    @ManyToOne(optional = false)
    private Beneficiario idBeneficiario;

    public Salida() {
    }

    public Salida(Integer idSalida) {
        this.idSalida = idSalida;
    }

    public Salida(Integer idSalida, String comAdicionales, int auAddUsr, Date auAddDat) {
        this.idSalida = idSalida;
        this.comAdicionales = comAdicionales;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdSalida() {
        return idSalida;
    }

    public void setIdSalida(Integer idSalida) {
        this.idSalida = idSalida;
    }

    public String getComAdicionales() {
        return comAdicionales;
    }

    public void setComAdicionales(String comAdicionales) {
        this.comAdicionales = comAdicionales;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Tiposalida getIdTipoSalida() {
        return idTipoSalida;
    }

    public void setIdTipoSalida(Tiposalida idTipoSalida) {
        this.idTipoSalida = idTipoSalida;
    }

    public Beneficiario getIdBeneficiario() {
        return idBeneficiario;
    }

    public void setIdBeneficiario(Beneficiario idBeneficiario) {
        this.idBeneficiario = idBeneficiario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSalida != null ? idSalida.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Salida)) {
            return false;
        }
        Salida other = (Salida) object;
        if ((this.idSalida == null && other.idSalida != null) || (this.idSalida != null && !this.idSalida.equals(other.idSalida))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Salida[ idSalida=" + idSalida + " ]";
    }

    public Date getFecSalida() {
        return fecSalida;
    }

    public void setFecSalida(Date fecSalida) {
        this.fecSalida = fecSalida;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    public Collection<Salidaxbeneficiario> getSalidaxbeneficiarioCollection() {
        return salidaxbeneficiarioCollection;
    }

    public void setSalidaxbeneficiarioCollection(Collection<Salidaxbeneficiario> salidaxbeneficiarioCollection) {
        this.salidaxbeneficiarioCollection = salidaxbeneficiarioCollection;
    }
    
}
